package com.example.cloud.util;

import org.springframework.stereotype.Component;
import java.util.Random;

@Component
public class NicknameGenerator {
    
    private static final String[] ADJECTIVES = {
        "快乐", "可爱", "聪明", "活泼", "开朗", 
        "温柔", "善良", "优雅", "文静", "阳光",
        "勇敢", "机智", "幽默", "睿智", "淡定"
    };
    
    private static final String[] NOUNS = {
        "小猫", "小狗", "小兔", "小鹿", "小象",
        "小熊", "小鸟", "小鱼", "小龙", "小狐",
        "精灵", "天使", "宝贝", "勇士", "骑士"
    };
    
    private final Random random = new Random();
    
    /**
     * 生成随机昵称
     * @return 随机昵称
     */
    public String generate() {
        String adjective = ADJECTIVES[random.nextInt(ADJECTIVES.length)];
        String noun = NOUNS[random.nextInt(NOUNS.length)];
        int number = random.nextInt(1000);
        return String.format("%s%s%03d", adjective, noun, number);
    }
} 